﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace lxwmvc
{
    /// <summary>
    /// 处理消息
    /// </summary>
    class WeiXin_Message
    {
        static void write(string xml)
        {
            HttpContext.Current.Response.Write(xml);
        }
        internal static void textAction(textMessage textMessage)
        {
            //处理消息
            //var text = WeiXin_SendMessage.sendTextMessage(textMessage.FromUserName, textMessage.ToUserName, "你也好!");
            //write(text);

            List<newsItem> list = new List<newsItem>();
            list.Add(new newsItem() { 
                 Title = "测试",
                 Description = "还是描述",
                 PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                 Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            list.Add(new newsItem()
            {
                Title = "测试",
                Description = "还是描述",
                PicUrl = "https://www.baidu.com/img/bd_logo1.png",
                Url = "https://www.baidu.com"
            });
            var text = WeiXin_SendMessage.sendNewsMessage(textMessage.FromUserName, textMessage.ToUserName, list);
            write(text);
        }

        internal static void imageAction(imageMessage imageMessage)
        {

        }

        internal static void voiceAction(voiceMessage voiceMessage)
        {

        }

        internal static void videoAction(videoMessage videoMessage)
        {
        }

        internal static void shortvideoAction(shortvideoMessage shortvideoMessage)
        {
        }

        internal static void linkAction(linkMessage linkMessage)
        {
        }

        internal static void locationAction(locationMessage locationMessage)
        {
        }

        internal static void eventAction(EventMessage eventMessage)
        {
            
        }

        internal static void subscribeEventAction(subscribeEventMessage subscribeEventMessage)
        {
        }

        internal static void SCANEventAction(SCANEventMessage sCANEventMessage)
        {
        }

        internal static void LOCATIONEventAction(LOCATIONEventMessage lOCATIONEventMessage)
        {
        }

        internal static void CLICKEventAction(CLICKEventMessage cLICKEventMessage)
        {
        }

        internal static void VIEWEventAction(VIEWEventMessage vIEWEventMessage)
        {
        }
    }
}
